{extend name="public/base" /}
    {block name="css"}
    <!-- Select2 -->
    <link rel="stylesheet" href="__ADMINLTE__plugins/select2/select2.min.css">
    {/block}
  {block name="content"}
    
      <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            编辑模型
            <small>Edit Model</small>
          </h1>
        </section>

        <!-- Main content -->
        <section class="content">

          <!-- SELECT2 EXAMPLE -->
          <div class="box box-default">
            <div class="box-header with-border">
              <h3 class="box-title">模型信息</h3>
              <div class="box-tools pull-right">
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
              </div>
            </div><!-- /.box-header -->
            <!-- form start -->
            <form role="form" action="{:U('TermModel/edit',['id'=>$info['id']])}" method="post">
            <div class="box-body">
              <div class="row">
                <div class="col-md-12">
                  <table class="table table-bordered">
            				<tr>
            				<th width="140">模型类型:</th>
            				<td>内容模型</td>
            				</tr>
            				<tr>
            					<th><font color="red">*</font> 名称： </th>
            					<td><input class="form-control" type="text" name="name" value="{$info.name}" size="30"  /></td>
            				</tr>
            				<tr>
            					<th><font color="red">*</font> 栏目模板： </th>
            					<td><input class="form-control" type="text" name="term_tpl" value="{$info.term_tpl}" size="30"  /></td>
            				</tr>
            				<tr>
            					<th><font color="red">*</font> 内容模板 </th>
            					<td><input class="form-control" type="text" name="content_tpl" value="{$info.content_tpl}" size="30"  /></td>
            				</tr>
          				</table>
                </div><!-- /.col -->
              </div><!-- /.row -->
            </div><!-- /.box-body -->
            <div class="box-footer">
              <button type="submit" class="btn btn-primary">确认修改</button>
            </div>
            </form>
          </div><!-- /.box -->

          <div class="row">
            <div class="col-md-6">
              <div class="box">
                <div class="box-header">
                  <h3 class="box-title">栏目页自定义标签</h3>
                  <div class="box-tools pull-right">
                    <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                    <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
                  </div>
                </div><!-- /.box-header -->
                <div class="box-body table-responsive no-padding">
                  <table class="table table-hover">
                    <tr>
                      <th style="width: 80px">标签标识</th>
                      <th>标签名</th>
                      <th style="width: 80px">标签类型</th>
                      <th style="width: 100px">操作</th>
                    </tr>
                    {foreach $termTagsList as $tag => $vo}
                    <tr>
                        <td>{$tag}</td>
                        <td>{$vo.tag_name}</td>
                        <td>{$vo.tag_type}</td>
                        <td>
                            <div class="btn-group">
                                <a onclick="jump('{:U('TermModel/delTermTag',['id'=>$info['id'], 'tag'=>$tag])}')" class="btn btn-primary btn-xs">删除</a>
                            </div>
                        </td>
                    </tr>
                    {/foreach}
                  </table>
                </div><!-- /.box-body -->
                <div class="box-footer">
                    <button style="width: 80px" onclick="jump('{:U('TermModel/addTermTag', ['id'=>$info['id']])}')" class="btn btn-sm btn-success">添加</button>
                </div>
              </div><!-- /.box -->
            </div><!-- /.col -->
            <div class="col-md-6">
              <div class="box">
                <div class="box-header">
                  <h3 class="box-title">内容页自定义标签</h3>
                  <div class="box-tools pull-right">
                    <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                    <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
                  </div>
                </div><!-- /.box-header -->
                <div class="box-body table-responsive no-padding">
                  <table class="table table-hover">
                    <tr>
                      <th style="width: 80px">标签标识</th>
                      <th>标签名</th>
                      <th style="width: 80px">标签类型</th>
                      <th style="width: 100px">操作</th>
                    </tr>
                    {foreach $contentTagsList as $tag => $vo}
                    <tr>
                        <td>{$tag}</td>
                        <td>{$vo.tag_name}</td>
                        <td>{$vo.tag_type}</td>
                        <td>
                            <div class="btn-group">
                                <a type="button" onclick="jump('{:U('TermModel/delContentTag',['id'=>$info['id'], 'tag'=>$tag])}')"  class="btn btn-primary btn-xs">删除</a>
                            </div>
                        </td>
                    </tr>
                    {/foreach}
                  </table>
                </div><!-- /.box-body -->
                <div class="box-footer">
                    <button style="width: 80px" onclick="jump('{:U('TermModel/addContentTag', ['id'=>$info['id']])}')" class="btn btn-sm btn-success">添加</button>
                </div>
              </div><!-- /.box -->
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section>
		  <!-- Main content END-->
    
  {/block}
{block name="script"}
    <!-- Select2 -->
    <script src="__ADMINLTE__plugins/select2/select2.full.min.js"></script>
    <script>
        var jump = function(url){
            window.location.href = url;
        }
        //Initialize Select2 Elements
        $(".select2").select2();
    </script>
{/block}
